﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Giraffe.Client.Common;
using Giraffe.Client.ConversationModule.Resources;
using Microsoft.Practices.Composite.Modularity;
using Giraffe.Core.Common;
using Giraffe.Client.Common.Managers;
using Microsoft.Practices.Composite.Regions;
using Giraffe.Client.Common.Constants;

namespace Giraffe.Client.ConversationModule
{
    public class ConversationModule: IModule
    {
        private readonly IRegionManager _regionManager;

        public ConversationModule(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }

        #region Implementation of IModule

        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            LoadResources();

            ObjectProvider.RegisterInstance<IConversationManagerPresentation>(ObjectProvider.Resolve<ConversationManagerPresentation>());



        }

        #endregion

        private void LoadResources()
        {
            var app = ObjectProvider.Resolve<IApplicationProxy>();
            app.Resources.MergedDictionaries.Add(new DataTemplateDictionary());
            app.Resources.MergedDictionaries.Add(new ResourcesDictionary());
        }
    }
}
